Test Series - java script

Test Number 68/92

Q: How many default number methods are available in JavaScript?
A. 5
B. 6
C. 7
D. 8
Solution: There are a total of 7 default number methods in JavaScript namely:
constructor()
toExponential()
toFixed()
toLocaleString()
toPrecision()
toString()
valueOf()
Q: What is the observer effect?
A. Observing influences outcome
B. Observing never influences outcome
C. Observing and the outcome are independent
D. Observing and the outcome are not related
Solution: The observer effect says that simply observing an act influences its outcome. This is often the result of instruments that, by necessity, alter the state of what they measure in some manner.
Q: Which of the following are ways to benchmark code?
A. Timing the code
B. Calculating the number of operations performed
C. Timing the code & Calculating the number of operations performed
D. Calculating the number of lines
Solution: There are a couple of ways to benchmark code—either by timing it or by calculating the number of operations performed during execution. Both of them help in calculating how efficient and modular the code.
Q: How to calculate the run time of a code?
A. Start time – End time
B. End time – Start time
C. Start time/ End time
D. Start time * End time
Solution: Run-time statements use the static resources created by compile-time statements, but can also create, use, and destroy dynamic resources at run time. The run time of code can be calculated as:
run time = end time – start time
Q: According to the workflow of a runtime logging, what happens after calculating the run time?
A. Display to screen
B. Log to server
C. Either Display to screen or Log to server
D. Server to log
Solution: According to the workflow of a runtime logging, after calculating the run time, decision boxes are kept that will check to either display to the debug screen or log to the server.
Q: Which of the following object is used to post the data to an external process, say savePerfData?
A. XML
B. XBT
C. XHR
D. XTR
Solution: XHR(XMLHttpRequest) is an API in the form of an object whose methods transfer data between a web browser and a web server. The benchmarking process will call the external process. We use XHR object to post the data to the external process.
Q: Where does the external process save the result of the test?
A. Normal file
B. Flat file
C. Folder
D. exe file
Solution: A flat file consists of a single table of data. It allows the user to specify data attributes, such as columns and data types table by table, and stores those attributes separate from applications. The external process, say savePerfData should in turn save the results of the test in a flat file.
Q: Which function is used to start the time logging?
A. startTimeLogging()
B. start()
C. Loggingstart()
D. startLogging()
Solution: The function startTimeLogging() is used to start the time logging. The startTimeLogging() method captures the timing data for ad hoc, etc for referencing an uncached document.location.
Q: Which of the following attribute of form tag is not set by using document object in JavaScript?
A. Target
B. Enctype
C. Action
D. Logging
Solution: Target, enctype & action can be set by using the document object in JavaScript. The Document object has various properties that refer to other objects which allow access to and modification of document content.
Q: What will be the output of the following JavaScript function?

A. SanfoundryThe Best
B. Sanfoundry The Best
C. Object required error
D. Javascript Error
Solution: The write() method writes HTML expressions or JavaScript code to a document.The write() method is mostly used for testing: If it is used after an HTML document is fully loaded, it will delete all existing HTML. The output for the above code is Sanfoundry The Best.

You Have Score    /10